package com.guoxin.chapter1.simpleNum;

/**
 * @author guoxin
 * @date 2019/8/15
 */
public class MyThread implements Runnable {
    private int i = 5;

    @Override
    public void run() {
        //出现线程不安全，虽然println()方法内部是同步的，但i--的操作却是在进入println()之前发生的
        System.out.println("i=" + (i--) + " threadName=" + Thread.currentThread().getName());
    }
}
